// routes路由配置的类型限制
import type { RouteRecordRaw } from 'vue-router';

export const routes: RouteRecordRaw[] = [
    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'Home',
                component: () => import('@/views/Home/index.vue'),
                redirect:'/home/recommend',
                //搭建子路由
                children:[
                    { 
                      path:'/home/recommend',
                      name:'Recommend',
                      component: () => import('@/views/Home/views/Recommend/index.vue')
                    
                    },
                    {
                      path:'/home/production',
                      name:'Production',
                      component:()=>import('@/views/Home/views/Production/index.vue')
                    },
                    {
                        path:'/home/teach',
                        name:"Teach",
                        component:()=>import('@/views/Home/views/Course/index.vue')

                    },
                    {
                        path:'/home/specialtopic',
                        name:"SpecialTopic",
                        component:()=>import('@/views/Home/views/specialTopic/index.vue')
                    },
                    {
                        path:'/home/information',
                        name:"Information",
                        component:()=>import('@/views/Home/views/Information/index.vue')

                    },
                    {
                        path:'/home/attention',
                        name:"Attention",
                        component:()=>import('@/views/Home/views/Attention/index.vue')
                        
                    }
                    
                  ]
            },
            {
                path: 'course',
                name: 'Course',
                component: () => import('@/views/Course/index.vue'),
                redirect: '/course/vip1',
                children: [
                    {
                        path: 'belowLine',
                        name: 'BelowLine',
                        component: () => import("@/views/Course/components/belowLine/belowLinePart.vue")
                    },
                    {
                        path: 'liveCourse',
                        name: 'LiveCourse',
                        component: () => import("@/views/Course/components/liveCourse/liveCoursePart.vue")
                    },
                    {
                        path: 'theme',
                        name: 'theMe',
                        component: () => import("@/views/Course/components/theme/theMePart.vue")
                    },
                    {
                        path: 'video',
                        name: 'Video',
                        component: () => import("@/views/Course/components/video/videoPart.vue")
                    },
                    {
                        path: 'vip1',
                        name: 'Vip1',
                        component: () => import("@/views/Course/components/vip/vipPart.vue")
                    }
                ]
            },
            {
                path: 'trainingroom',
                name: 'TrainingRoom',
                component: () => import('@/views/TrainingRoom/index.vue'),
                redirect: '/trainingroom/training',
                children: [
                    {
                        path: 'training',
                        name: 'Training',
                        component: () => import('@/views/TrainingRoom/views/Training/index.vue')
                    },
                    {
                        path: 'collections',
                        name: 'Collections',
                        component: () => import('@/views/TrainingRoom/views/Collections/index.vue')
                    },
                    {
                        path: 'mediaCach',
                        name: 'MediaCach',
                        component: () => import('@/views/TrainingRoom/views/MediaCache/index.vue')
                    },
                    {
                        path: 'history',
                        name: 'History',
                        component: () => import('@/views/TrainingRoom/views/History/index.vue')
                    }
                ]
            },
            {
                path: 'communication',
                name: 'Communication',
                component: () => import('@/views/Communication/index.vue')
            },
            {
                path: 'my',
                name: 'My',
                redirect: '/my/dynamics',
                component: () => import('@/views/My/index.vue'),
                children: [
                    {
                        path: 'dynamics',
                        name: 'Dynamics',
                        component: () => import('@/views/My/components/dynamics/index.vue')
                    },
                    {
                        path: 'vip',
                        name: "Vip",
                        component: () => import('@/views/My/components/vip/index.vue')
                    },
                    {
                        path: 'wallet',
                        name: 'Wallet',
                        component: () => import('@/views/My/components/wallet/index.vue')
                    },
                    {
                        path: 'coupons',
                        name: 'Coupons',
                        component: () => import('@/views/My/components/coupons/index.vue')
                    },
                    {
                        path: 'edit_info',
                        name: 'Edit-info',
                        component: () => import('@/views/My/components/edit_info/index.vue')
                    },
                    {
                        path: 'my_order',
                        name: 'My_order',
                        component: () => import('@/views/My/components/my_order/index.vue')
                    },
                    {
                        path: 'orders_manager',
                        name: 'Orders_manager',
                        component: () => import('@/views/My/components/orders_manager/index.vue')
                    },
                    {
                        path: 'goods_manager',
                        name: 'Goods_manager',
                        component: () => import('@/views/My/components/goods_manager/index.vue')
                    },
                    {
                        path: 'customers_manager',
                        name: 'Customers_manager',
                        component: () => import('@/views/My/components/customers_manager/index.vue')
                    },
                    {
                        path: 'pending_payments_manager',
                        name: 'Pending_payments_manager',
                        component: () => import('@/views/My/components/pending_payments_manager/index.vue')
                    },
                    {
                        path: 'minePreferentialManagement',
                        name: 'MinePreferentialManagement',
                        component: () => import('@/views/My/components/minePreferentialManagement/index.vue')
                    },
                    {
                        path: 'mineReviewsManagement',
                        name: 'MineReviewsManagement',
                        component: () => import('@/views/My/components/mineReviewsManagement/index.vue')
                    },
                    {
                        path: 'deposit',
                        name: 'Deposit',
                        component: () => import('@/views/My/components/deposit/index.vue')
                    }
                ]

            },
        ]

    },
    {
        path: '/404',
        name: '404',
        component: () => import('@/views/NotFound/index.vue')
    },
    // 任意路由
    {
        path: '/:pathMatch(.*)',
        name: 'Any',
        redirect: '/404'
    }

]
